<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="support.*, java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Graduate School Application - More Degrees</title>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<link rel="stylesheet" type="text/css" href="../resource/styleCSS.css" />
	<link rel="stylesheet" type="text/css" href="../resource/columnCSS.css" />
</head>
<body>
	<%
		String major = (String) request.getParameter("major");
		String month = (String) request.getParameter("month");
		String year = (String) request.getParameter("year");
		String gpa = (String) request.getParameter("gpa");
		String title = (String) request.getParameter("title");
		String transcript = (String) request.getParameter("transcript");
	
		// Get session information
		String fname = (String)session.getAttribute("fname");
		String lname = (String)session.getAttribute("lname");
		String mname = (String)session.getAttribute("mname");
		
		String citizen = (String)session.getAttribute("citizen");
		String residence = (String)session.getAttribute("residence");
		
		String address = (String)session.getAttribute("address"); 
		String city = (String)session.getAttribute("city");
		String state = (String)session.getAttribute("state");
		Integer zipcode = (Integer)session.getAttribute("zipcode");
		Integer areacode = (Integer)session.getAttribute("areacode");
		Integer number = (Integer)session.getAttribute("number");
		Integer countrycode = (Integer)session.getAttribute("countrycode");
		Boolean domestic = (Boolean)session.getAttribute("domestic");
		
		Vector degreeInfo = (Vector) session.getAttribute("degreeInfo");
		
		if (degreeInfo != null && degreeInfo.size() < 3) {
			degreeInfo.add(major);
			degreeInfo.add(month);
			degreeInfo.add(year);
			degreeInfo.add(gpa);
			degreeInfo.add(title);
			degreeInfo.add(transcript);
			session.setAttribute("degreeInfo", degreeInfo);
		
			Vector degrees = (Vector) session.getAttribute("degrees");
			degrees.add(degreeInfo);
			session.setAttribute("degrees", degrees);
		}
		else {
			System.err.println("[DEBUG] Unable to add degree discipline " +
					"to degree Info");
		}
	%>
	<p class="sansserif">
	<div class="container">
	<div class="center_div">
		<div class="colmask threecol">
		<div class="colmid">
		<div class="colleft">
			<div class="bodycol">
				<p>Applicant: <i><%= fname%> <%= mname%> <%= lname%></i></p> 
				<p>Citizenship: <i><%= citizen%></i></p>
				<p>Country of Residence: <i><%= residence%></i></p> 
				<p>Address: <i><%= address%></i></p>
				<p>City: <i><%= city%></i> 
				<%
					if ( state != null ) {
						out.println("State: <i>" + state + "</i>");
					}
				%>
				Zip Code: <i><%= zipcode%></i></p>
				<p>Telephone: <i><%= areacode %> <%= number%></i>
				<%
					if ( countrycode != null ) {
						out.println("Country Code: <i>" + countrycode + "</i>");
					}
				%>
				</p>
				<p>Domestic: <i><%= domestic%> </i> </p>
				<br>
			</div>
			<div class="sidecol">
				<p><a href="../invalidate.jsp">Logout</a></p>
			</div>
		</div>
		</div>
		</div>
		<div style="clear:both;"></div>
		
		<p><b>More Degrees</b> </p>
		
		<ul class="none">
		<li>Choose <a href=degreesChooseLocationJSP.jsp><i>Submit Next Degree</i></a> to submit additional degrees.
			Otherwise choose <i>Done</i>.</li>
		<br>
		<li>
			<form method="GET" action="specializationJSP.jsp">
				<input type="submit" value="Done"/>
			</form>
		</li>
		<br>
		<%			
			Vector printDegrees = (Vector) session.getAttribute("degrees");
			if(printDegrees != null)
			{
				for(int i = 0; i < printDegrees.size(); i++)
				{
					Vector currDegree = (Vector) printDegrees.elementAt(i);
					out.print("<li> <u>Degree " + (i + 1) + "</u></li>");
					out.print("<li><ul class=\"none\">");
					out.print("<li>Location: <i>" + (String)currDegree.elementAt(0) + "</i></li>");
					out.print("<li>University: <i>" + (String)currDegree.elementAt(1) + "</i></li>");
					out.print("<li>Discipline: <i>" + (String)currDegree.elementAt(2) + "</i></li>");
					out.print("<li>Degree Awarded: <i>" + (String)currDegree.elementAt(3) + "/");
					out.print((String)currDegree.elementAt(4) + "</i></li>");
					out.print("<li>GPA: <i>" + (String)currDegree.elementAt(5) + "</i></li>");
					out.print("<li>Title of Degree: <i>" + (String)currDegree.elementAt(6) + "</i></li>");
					out.print("<li>Transcript: <i>" + (String)currDegree.elementAt(7) + "</i></li>");
					out.print("<br>");
					out.print("</ul></li>");
				}
			}
			
		%>
		</ul>	
	</div>
	</div>
</body>
</html>